<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateMenusTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('menus', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string("name",50)->comment("导航名称");
            $table->string("route_name",50)->nullable()->comment("路由名称");
            $table->string("icon",50)->nullable()->comment("图标");
            $table->integer("pid")->default(0)->comment("父级id");
            $table->boolean("target")->default(0)->comment("新窗口打开");
            $table->integer("level")->default(1)->comment("排序");
            $table->string("guard_name",20)->nullable()->comment("guard");
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('menus');
    }
}
